package com.fesine.quartz.chapter4;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/11/19 16:22
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/11/19 16:22
 */
public class PrintJob implements Job {
    static Log logger = LogFactory.getLog(PrintJob.class);
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDetail detail = context.getJobDetail();
        String jobName = detail.getName();
        logger.info("Name:" + detail.getFullName());
        logger.info("Job class:" + detail.getJobClass());
        logger.info(jobName + " fire at " + context.getFireTime());
        logger.info(jobName + " next fire time " + context.getNextFireTime());
    }
}
